package com.gitee.wsl.mathematics.matrix.mat

import com.gitee.wsl.io.dataproxy.DataProxy
import com.gitee.wsl.io.dataproxy.asProxy
import com.gitee.wsl.mathematics.matrix.M
import com.gitee.wsl.mathematics.matrix.MatrixD
import com.gitee.wsl.mathematics.matrix.MutableMatrix
import com.gitee.wsl.mathematics.matrix.N
import com.gitee.wsl.mathematics.vector.vec.Vec

abstract class AbstractMatrix<M:MatrixD<M, Vec>>(
                               override val rowCount: Int,
                               override val colCount: Int,
                               override val proxy: DataProxy<Double>
) : MatrixD<M, Vec> {

        override val m by lazy{ (0 until rowCount).map { M[it] }}

        override val n by lazy {(0 until colCount).map { N[it] }}

        override val det: Double
        get() = TODO("Not yet implemented")

        override val adjoin: M
        get() = TODO("Not yet implemented")

    override fun create(values: List<Double>): M {
        TODO("Not yet implemented")
    }

    override fun toMutable(): MutableMatrix<Double, M, Vec> {
        TODO("Not yet implemented")
    }

    override fun createVec(indexes: List<Int>) = Vec( proxy = proxy.asProxy(indexes))

        override fun times(other: M): M {
            TODO("Not yet implemented")
            /*require(colCount == other.rowCount){" this cols must eques that rows"}
            val ret = Mat(colCount ,other.rowCount)
            for(i in 0 until  rowCount){
                for(j in 0 until  other.colCount){
                    ret.proxy[i col j] = M[i] dot other.n[j]
                }
            }
            return ret*/

        }

}